home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Applications / Fractal Generator / Maps / Fractals < prev    next >
Text File  |  1993-06-07  |  3KB  |  104 lines

  1. ( Preset fractals module for Fractal Lab Kit,  RTK, 05-18-93 )
  2. ( news words:  preset, individual fractal names )
  3.  
  4. forget task : task ;
  5.  
  6. : koch ( -- ) ( load maps to generate the Koch curve )
  7.     0.333 0.0 0.0 0.333 0.0 0.0 0.25 1 set
  8.     0.167 -0.288 0.288 0.167 0.333 0.0 0.25 2 set
  9.     0.167 0.288 -0.288 0.167 0.5 0.288 0.25 3 set
  10.     .333 0. 0. .333 .667 0. .25 4 set
  11.     4 maps ;
  12.  
  13. : hindu ( -- ) ( load Hindu maps )
  14.     .5 0. 0. .48 0. 0. .32 1 set
  15.     .5 0. 0. .48 .5 0. .32 2 set
  16.     .34 0. 0. .48 .33 .52 .32 3 set
  17.     .1 0. 0. -0.1 .45 .36 .04 4 set
  18.     4 maps ;
  19.  
  20. : fern ( -- ) ( load Fern maps )
  21.     .81 .07 -0.04 .84 .12 .195 .75 1 set
  22.     .18 -0.25 .27 .23 .12 .02 .115 2 set
  23.     .19 .275 .238 -.14 .16 .12 .115 3 set
  24.     .0235 .087 .045 .1666 .11 0. .02 4 set
  25.     4 maps ;
  26.  
  27. : blocks ( -- ) ( load Blocks maps )
  28.     0. .3 .54 0. .69 .44 .21 1 set
  29.     -.65 0. 0. .41 .66 .57 .26 2 set
  30.     .24 0. 0. -.32 .33 .35 .15 3 set
  31.     .38 0. 0. .41 .6 .02 .19 4 set
  32.     -.28 0. 0. -.523 .3 .53 .19 5 set
  33.     5 maps ;
  34.  
  35. : cantor ( -- ) ( load Cantor set maps )
  36.     .33 0. 0. .33 0. .4 .5 1 set
  37.     .33 0. 0. .33 .67 .4 .5 2 set
  38.     2 maps ;
  39.  
  40. : dust ( -- ) ( load Dust maps )
  41.     .3 0. 0. .3 0. 0. .2 1 set
  42.     .3 0. 0. .3 .7 0. .2 2 set
  43.     .3 0. 0. .3 0. .7 .2 3 set
  44.     .3 0. 0. .3 .7 .7 .2 4 set
  45.     .3 0. 0. .3 .35 .35 .2 5 set
  46.     5 maps ;
  47.  
  48. : burst ( -- ) ( load Burst maps )
  49.     .3 0. .25 .1 0. .01 .12 1 set
  50.     -.3 0. -.25 -.1 .99 .99 .12 2 set
  51.     .7 .3 0. -.98 0. .99 .7 3 set
  52.     .1 -.3 .3 .1 .6 .3 .06 4 set
  53.     4 maps ;
  54.  
  55. : circles ( -- ) ( load Circle maps )
  56.     .2929 -.2929 .2929 .2929 .5 .5 .25 1 set
  57.     .2929 .2929 -.2929 .2929 .5 .5 .25 2 set
  58.     -.2929 .2929 -.2929 -.2929 .5 .5 .25 3 set
  59.     -.2929 -.2929 .2929 -.2929 .5 .5 .25 4 set
  60.     4 maps ;
  61.  
  62. : terror ( -- ) ( load Terror maps )
  63.     .3 .3 .54 0. .39 .44 .21 1 set
  64.     -.65 .2 -.1 .41 .66 .57 .26 2 set
  65.     .24 0. .2 -.32 .33 .35 .15 3 set
  66.     .38 -.1 0. .41 .6 .02 .19 4 set
  67.     -.28 0. -.1 -.523 .3 .63 .19 5 set
  68.     5 maps ;
  69.  
  70. : tree ( -- ) ( load Tree maps )
  71.     .03 0. 0. .48 -.005 0. .05 1 set
  72.     .03 0. 0. .48 .01 0. .05 2 set
  73.     .035 0. 0. -.44 .01 .21 .05 3 set
  74.     .035 0. 0. .41 -.007 .02 .05 4 set
  75.     .41 -.41 .41 .41 -.1 .23 .4 5 set
  76.     .41 .41 -.41 .41 .01 .23 .4 6 set
  77.     6 maps ;
  78.  
  79. : spiral ( -- ) ( load Spiral maps )
  80.     .96 .15 -.15 .96 -.08 .0861 .955 1 set
  81.     .11 -.05 .05 .11 1.11 .8 .045 2 set
  82.     2 maps ;
  83.  
  84. : preset ( -- ) ( Load a preset fractal map )
  85.     page cr ." Predefined fractals : " cr cr
  86.     ."   1. Koch curve" cr ."   2. Hindu" cr ."   3. Fern leaf" cr
  87.     ."   4. Blocks" cr ."   5. Cantor set" cr ."   6. Dust" cr
  88.     ."   7. Burst" cr ."   8. Circles" cr ."   9. Terror" cr
  89.     ."  10. Tree" cr ."  11. Spiral" cr cr
  90.     ." Which ? " input
  91.     dup 1 = if drop koch else
  92.     dup 2 = if drop hindu else
  93.     dup 3 = if drop fern else
  94.     dup 4 = if drop blocks else
  95.     dup 5 = if drop cantor else
  96.     dup 6 = if drop dust else
  97.     dup 7 = if drop burst else
  98.     dup 8 = if drop circles else
  99.     dup 9 = if drop terror else
  100.     dup 10 = if drop tree else
  101.        11 = if spiral else ." Illegal value ! " quit
  102.     then then then then then then then then then then then
  103.     cr ." Predefined maps loaded, " nmaps @ . ." maps total." cr cr ;
  104.